class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: C = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: A = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
d = B("d")
e = A("e")
n = A("n")
j = B("j")
m = C("m")
c = A("c")

f.u = c
f.x = a
f.t = e
b.w = e
b.o = m
b.v = m
a.q = m
a.v = e
d.w = f
d.o = a
d.v = m
e.u = n
e.x = a
e.t = f
n.u = f
n.x = m
n.t = c
j.w = n
j.o = m
j.v = m
m.q = a
m.v = n
c.u = n
c.t = n
c.x = a
assert e.u.u.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: C = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: A = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
d = B("d")
e = A("e")
n = A("n")
j = B("j")
m = C("m")
c = A("c")

f.u = c
f.x = a
f.t = e
b.w = e
b.o = m
b.v = m
a.q = m
a.v = e
d.w = f
d.o = a
d.v = m
e.u = n
e.x = a
e.t = f
n.u = f
n.x = m
n.t = c
j.w = n
j.o = m
j.v = m
m.q = a
m.v = n
c.u = n
c.t = n
c.x = a
assert e.u.u.t.t.txt == "f"