diff --git a/pyupgrade.py b/pyupgrade.py
index a9c6cd5..0dcc2e0 100644
--- a/pyupgrade.py
+++ b/pyupgrade.py
@@ -490,6 +490,10 @@ def _fix_octal(s):
         return '0o' + s[1:]
 
 
+def _is_string_prefix(token):
+    return token.name == 'NAME' and set(token.src.lower()) <= set('bfru')
+
+
 def _fix_tokens(contents_text, py3_plus):
     remove_u_prefix = py3_plus or _imports_unicode_literals(contents_text)
 
@@ -503,7 +507,7 @@ def _fix_tokens(contents_text, py3_plus):
         elif token.name == 'STRING':
             # when a string prefix is not recognized, the tokenizer produces a
             # NAME token followed by a STRING token
-            if i > 0 and tokens[i - 1].name == 'NAME':
+            if i > 0 and _is_string_prefix(tokens[i - 1]):
                 tokens[i] = token._replace(src=tokens[i - 1].src + token.src)
                 tokens[i - 1] = tokens[i - 1]._replace(src='')
 

diff --git a/tests/pyupgrade_test.py b/tests/pyupgrade_test.py
index 9c6db3d..4c56411 100644
--- a/tests/pyupgrade_test.py
+++ b/tests/pyupgrade_test.py
@@ -323,6 +323,14 @@ def test_imports_unicode_literals(s, expected):
         ),
         # Regression: string containing newline
         ('"""with newline\n"""', True, '"""with newline\n"""'),
+        pytest.param(
+            'def f():\n'
+            '    return"foo"\n',
+            True,
+            'def f():\n'
+            '    return"foo"\n',
+            id='Regression: no space between return and string',
+        ),
     ),
 )
 def test_unicode_literals(s, py3_plus, expected):

unicode literal fixer `return'foo'`
Mistakenly does the following:

```diff
-    return'foo'
+    retrn'foo'
```
tests/pyupgrade_test.py::test_unicode_literals[Regression:
tests/pyupgrade_test.py::test_roundtrip_text[] tests/pyupgrade_test.py::test_roundtrip_text[foo] tests/pyupgrade_test.py::test_roundtrip_text[{}] tests/pyupgrade_test.py::test_roundtrip_text[{0}] tests/pyupgrade_test.py::test_roundtrip_text[{named}] tests/pyupgrade_test.py::test_roundtrip_text[{!r}] tests/pyupgrade_test.py::test_roundtrip_text[{:>5}] tests/pyupgrade_test.py::test_roundtrip_text[{{] tests/pyupgrade_test.py::test_roundtrip_text[}}] tests/pyupgrade_test.py::test_roundtrip_text[{0!s:15}] tests/pyupgrade_test.py::test_intentionally_not_round_trip[{:}-{}] tests/pyupgrade_test.py::test_intentionally_not_round_trip[{0:}-{0}] tests/pyupgrade_test.py::test_intentionally_not_round_trip[{0!r:}-{0!r}] tests/pyupgrade_test.py::test_sets[set()-set()] tests/pyupgrade_test.py::test_sets[set((\n))-set((\n))] tests/pyupgrade_test.py::test_sets[set tests/pyupgrade_test.py::test_sets[set(())-set()] tests/pyupgrade_test.py::test_sets[set([])-set()] tests/pyupgrade_test.py::test_sets[set(( tests/pyupgrade_test.py::test_sets[set((1, tests/pyupgrade_test.py::test_sets[set([1, tests/pyupgrade_test.py::test_sets[set(x tests/pyupgrade_test.py::test_sets[set([x tests/pyupgrade_test.py::test_sets[set((x tests/pyupgrade_test.py::test_sets[set(((1, tests/pyupgrade_test.py::test_sets[set((a, tests/pyupgrade_test.py::test_sets[set([(1, tests/pyupgrade_test.py::test_sets[set(\n tests/pyupgrade_test.py::test_sets[set([((1, tests/pyupgrade_test.py::test_sets[set((((1, tests/pyupgrade_test.py::test_sets[set(\n(1, tests/pyupgrade_test.py::test_sets[set((\n1,\n2,\n))\n-{\n1,\n2,\n}\n] tests/pyupgrade_test.py::test_sets[set((frozenset(set((1, tests/pyupgrade_test.py::test_sets[set((1,))-{1}] tests/pyupgrade_test.py::test_dictcomps[x tests/pyupgrade_test.py::test_dictcomps[dict()-dict()] tests/pyupgrade_test.py::test_dictcomps[(-(] tests/pyupgrade_test.py::test_dictcomps[dict tests/pyupgrade_test.py::test_dictcomps[dict((a, tests/pyupgrade_test.py::test_dictcomps[dict([a, tests/pyupgrade_test.py::test_dictcomps[dict(((a, tests/pyupgrade_test.py::test_dictcomps[dict([(a, tests/pyupgrade_test.py::test_dictcomps[dict(((a), tests/pyupgrade_test.py::test_dictcomps[dict((k, tests/pyupgrade_test.py::test_dictcomps[dict(\n tests/pyupgrade_test.py::test_dictcomps[x(\n tests/pyupgrade_test.py::test_format_literals["{0}"format(1)-"{0}"format(1)] tests/pyupgrade_test.py::test_format_literals['{}'.format(1)-'{}'.format(1)] tests/pyupgrade_test.py::test_format_literals['{'.format(1)-'{'.format(1)] tests/pyupgrade_test.py::test_format_literals['}'.format(1)-'}'.format(1)] tests/pyupgrade_test.py::test_format_literals[x tests/pyupgrade_test.py::test_format_literals['{0} tests/pyupgrade_test.py::test_format_literals['{0}'.format(1)-'{}'.format(1)] tests/pyupgrade_test.py::test_format_literals['{0:x}'.format(30)-'{:x}'.format(30)] tests/pyupgrade_test.py::test_format_literals['''{0}\n{1}\n'''.format(1, tests/pyupgrade_test.py::test_format_literals['{0}' tests/pyupgrade_test.py::test_format_literals[print(\n tests/pyupgrade_test.py::test_format_literals['{0:<{1}}'.format(1, tests/pyupgrade_test.py::test_imports_unicode_literals[import tests/pyupgrade_test.py::test_imports_unicode_literals[from tests/pyupgrade_test.py::test_imports_unicode_literals[x tests/pyupgrade_test.py::test_imports_unicode_literals["""docstring"""\nfrom tests/pyupgrade_test.py::test_unicode_literals[(-False-(] tests/pyupgrade_test.py::test_unicode_literals[u''-False-u''] tests/pyupgrade_test.py::test_unicode_literals[u''-True-''] tests/pyupgrade_test.py::test_unicode_literals[from tests/pyupgrade_test.py::test_unicode_literals["""with tests/pyupgrade_test.py::test_fix_ur_literals[basic tests/pyupgrade_test.py::test_fix_ur_literals[upper tests/pyupgrade_test.py::test_fix_ur_literals[with tests/pyupgrade_test.py::test_fix_ur_literals[emoji] tests/pyupgrade_test.py::test_fix_ur_literals_gets_fixed_before_u_removed tests/pyupgrade_test.py::test_fix_escape_sequences_noop[""] tests/pyupgrade_test.py::test_fix_escape_sequences_noop[r"\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences_noop[r'\\d'] tests/pyupgrade_test.py::test_fix_escape_sequences_noop[r"""\\d"""] tests/pyupgrade_test.py::test_fix_escape_sequences_noop[r'''\\d'''] tests/pyupgrade_test.py::test_fix_escape_sequences_noop[rb"\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences_noop["\\\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences_noop["\\u2603"] tests/pyupgrade_test.py::test_fix_escape_sequences_noop["\\r\\n"] tests/pyupgrade_test.py::test_fix_escape_sequences_noop["""\\\n"""] tests/pyupgrade_test.py::test_fix_escape_sequences_noop["""\\\r\n"""] tests/pyupgrade_test.py::test_fix_escape_sequences_noop["""\\\r"""] tests/pyupgrade_test.py::test_fix_escape_sequences["\\d"-r"\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences["\\n\\d"-"\\n\\\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences[u"\\d"-u"\\\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences[b"\\d"-br"\\d"] tests/pyupgrade_test.py::test_fix_escape_sequences["\\8"-r"\\8"] tests/pyupgrade_test.py::test_fix_escape_sequences["\\9"-r"\\9"] tests/pyupgrade_test.py::test_fix_escape_sequences[b"\\u2603"-br"\\u2603"] tests/pyupgrade_test.py::test_fix_escape_sequences["""\\\n\\q"""-"""\\\n\\\\q"""] tests/pyupgrade_test.py::test_fix_escape_sequences["""\\\r\n\\q"""-"""\\\r\n\\\\q"""] tests/pyupgrade_test.py::test_fix_escape_sequences["""\\\r\\q"""-"""\\\r\\\\q"""] tests/pyupgrade_test.py::test_noop_octal_literals[0] tests/pyupgrade_test.py::test_noop_octal_literals[00] tests/pyupgrade_test.py::test_noop_octal_literals[1] tests/pyupgrade_test.py::test_noop_octal_literals[12345] tests/pyupgrade_test.py::test_noop_octal_literals[1.2345] tests/pyupgrade_test.py::test_is_bytestring_true[b''] tests/pyupgrade_test.py::test_is_bytestring_true[b""] tests/pyupgrade_test.py::test_is_bytestring_true[B""] tests/pyupgrade_test.py::test_is_bytestring_true[B''] tests/pyupgrade_test.py::test_is_bytestring_true[rb''0] tests/pyupgrade_test.py::test_is_bytestring_true[rb''1] tests/pyupgrade_test.py::test_is_bytestring_false[] tests/pyupgrade_test.py::test_is_bytestring_false[""] tests/pyupgrade_test.py::test_is_bytestring_false[''] tests/pyupgrade_test.py::test_is_bytestring_false[u""] tests/pyupgrade_test.py::test_is_bytestring_false["b"] tests/pyupgrade_test.py::test_parse_percent_format[""-expected0] tests/pyupgrade_test.py::test_parse_percent_format["%%"-expected1] tests/pyupgrade_test.py::test_parse_percent_format["%s"-expected2] tests/pyupgrade_test.py::test_parse_percent_format["%s tests/pyupgrade_test.py::test_parse_percent_format["%(hi)s"-expected4] tests/pyupgrade_test.py::test_parse_percent_format["%()s"-expected5] tests/pyupgrade_test.py::test_parse_percent_format["%#o"-expected6] tests/pyupgrade_test.py::test_parse_percent_format["% tests/pyupgrade_test.py::test_parse_percent_format["%5d"-expected8] tests/pyupgrade_test.py::test_parse_percent_format["%*d"-expected9] tests/pyupgrade_test.py::test_parse_percent_format["%.f"-expected10] tests/pyupgrade_test.py::test_parse_percent_format["%.5f"-expected11] tests/pyupgrade_test.py::test_parse_percent_format["%.*f"-expected12] tests/pyupgrade_test.py::test_parse_percent_format["%ld"-expected13] tests/pyupgrade_test.py::test_parse_percent_format["%(complete)#4.4f"-expected14] tests/pyupgrade_test.py::test_percent_to_format[%s-{}] tests/pyupgrade_test.py::test_percent_to_format[%%%s-%{}] tests/pyupgrade_test.py::test_percent_to_format[%(foo)s-{foo}] tests/pyupgrade_test.py::test_percent_to_format[%2f-{:2f}] tests/pyupgrade_test.py::test_percent_to_format[%r-{!r}] tests/pyupgrade_test.py::test_percent_to_format[%a-{!a}] tests/pyupgrade_test.py::test_simplify_conversion_flag[-] tests/pyupgrade_test.py::test_simplify_conversion_flag[ tests/pyupgrade_test.py::test_simplify_conversion_flag[#0- tests/pyupgrade_test.py::test_simplify_conversion_flag[--<] tests/pyupgrade_test.py::test_percent_format_noop["%s" tests/pyupgrade_test.py::test_percent_format_noop[b"%s" tests/pyupgrade_test.py::test_percent_format_noop["%*s" tests/pyupgrade_test.py::test_percent_format_noop["%.*s" tests/pyupgrade_test.py::test_percent_format_noop["%d" tests/pyupgrade_test.py::test_percent_format_noop["%i" tests/pyupgrade_test.py::test_percent_format_noop["%u" tests/pyupgrade_test.py::test_percent_format_noop["%c" tests/pyupgrade_test.py::test_percent_format_noop["%#o" tests/pyupgrade_test.py::test_percent_format_noop["%()s" tests/pyupgrade_test.py::test_percent_format_noop["%4%" tests/pyupgrade_test.py::test_percent_format_noop["%.2r" tests/pyupgrade_test.py::test_percent_format_noop["%.2a" tests/pyupgrade_test.py::test_percent_format_noop[i tests/pyupgrade_test.py::test_percent_format_noop["%(1)s" tests/pyupgrade_test.py::test_percent_format_noop["%(a)s" tests/pyupgrade_test.py::test_percent_format_noop["%(ab)s" tests/pyupgrade_test.py::test_percent_format_noop["%(and)s" tests/pyupgrade_test.py::test_percent_format["trivial" tests/pyupgrade_test.py::test_percent_format["%s" tests/pyupgrade_test.py::test_percent_format["%s%% tests/pyupgrade_test.py::test_percent_format["%3f" tests/pyupgrade_test.py::test_percent_format["%-5s" tests/pyupgrade_test.py::test_percent_format["%9s" tests/pyupgrade_test.py::test_percent_format["brace tests/pyupgrade_test.py::test_percent_format["%(k)s" tests/pyupgrade_test.py::test_percent_format["%(to_list)s" tests/pyupgrade_test.py::test_fix_super_noop[x(] tests/pyupgrade_test.py::test_fix_super_noop[class tests/pyupgrade_test.py::test_fix_super_noop[def tests/pyupgrade_test.py::test_fix_super[class tests/pyupgrade_test.py::test_fix_new_style_classes_noop[x tests/pyupgrade_test.py::test_fix_new_style_classes_noop[class tests/pyupgrade_test.py::test_fix_new_style_classes[class tests/pyupgrade_test.py::test_fix_six_noop[x tests/pyupgrade_test.py::test_fix_six_noop[isinstance(s, tests/pyupgrade_test.py::test_fix_six_noop[@ tests/pyupgrade_test.py::test_fix_six_noop[from tests/pyupgrade_test.py::test_fix_six_noop[@mydec\nclass tests/pyupgrade_test.py::test_fix_six_noop[six.u tests/pyupgrade_test.py::test_fix_six_noop[six.raise_from tests/pyupgrade_test.py::test_fix_six_noop[print(six.raise_from(exc, tests/pyupgrade_test.py::test_fix_six[isinstance(s, tests/pyupgrade_test.py::test_fix_six[issubclass(tp, tests/pyupgrade_test.py::test_fix_six[STRING_TYPES tests/pyupgrade_test.py::test_fix_six[from tests/pyupgrade_test.py::test_fix_six[@six.python_2_unicode_compatible\nclass tests/pyupgrade_test.py::test_fix_six[@six.python_2_unicode_compatible\n@other_decorator\nclass tests/pyupgrade_test.py::test_fix_six[six.get_unbound_method(meth)\n-meth\n] tests/pyupgrade_test.py::test_fix_six[six.indexbytes(bs, tests/pyupgrade_test.py::test_fix_six[six.assertCountEqual(\n tests/pyupgrade_test.py::test_fix_six[six.raise_from(exc, tests/pyupgrade_test.py::test_fix_six[six.reraise(tp, tests/pyupgrade_test.py::test_fix_six[six.reraise(\n tests/pyupgrade_test.py::test_fix_new_style_classes_py3only[class tests/pyupgrade_test.py::test_fix_fstrings_noop[(] tests/pyupgrade_test.py::test_fix_fstrings_noop["{}" tests/pyupgrade_test.py::test_fix_fstrings_noop["{}".format(\n tests/pyupgrade_test.py::test_fix_fstrings_noop["{} tests/pyupgrade_test.py::test_fix_fstrings_noop["{foo} tests/pyupgrade_test.py::test_fix_fstrings_noop["{0} tests/pyupgrade_test.py::test_fix_fstrings_noop["{x} tests/pyupgrade_test.py::test_fix_fstrings_noop["{x.y} tests/pyupgrade_test.py::test_fix_fstrings_noop[b"{} tests/pyupgrade_test.py::test_fix_fstrings_noop["{:{}}".format(x, tests/pyupgrade_test.py::test_fix_fstrings["{} tests/pyupgrade_test.py::test_fix_fstrings["{1} tests/pyupgrade_test.py::test_fix_fstrings["{x.y}".format(x=z)-f"{z.y}"] tests/pyupgrade_test.py::test_fix_fstrings["{.x} tests/pyupgrade_test.py::test_fix_fstrings["hello tests/pyupgrade_test.py::test_fix_fstrings["{}{{}}{}".format(escaped, tests/pyupgrade_test.py::test_main_trivial tests/pyupgrade_test.py::test_main_noop tests/pyupgrade_test.py::test_main_changes_a_file tests/pyupgrade_test.py::test_main_keeps_line_endings tests/pyupgrade_test.py::test_main_syntax_error tests/pyupgrade_test.py::test_main_non_utf8_bytes tests/pyupgrade_test.py::test_keep_percent_format tests/pyupgrade_test.py::test_py3_plus_argument_unicode_literals tests/pyupgrade_test.py::test_py3_plus_super tests/pyupgrade_test.py::test_py3_plus_new_style_classes tests/pyupgrade_test.py::test_py36_plus_fstrings