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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

f = A("f")
c = B("c")
e = C("e")
j = D("j")
k = B("k")
m = C("m")
l = C("l")
b = A("b")
a = D("a")
d = B("d")

f.q = a
f.t = b
f.v = j
c.z = m
c.u = a
c.s = j
e.x = j
e.q = k
j.u = a
k.z = m
k.u = a
k.s = a
m.x = j
m.q = d
l.x = a
l.q = k
b.q = j
b.t = f
b.v = a
a.u = j
d.z = m
d.u = j
d.s = a
assert e.q.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

f = A("f")
c = B("c")
e = C("e")
j = D("j")
k = B("k")
m = C("m")
l = C("l")
b = A("b")
a = D("a")
d = B("d")

f.q = a
f.t = b
f.v = j
c.z = m
c.u = a
c.s = j
e.x = j
e.q = k
j.u = a
k.z = m
k.u = a
k.s = a
m.x = j
m.q = d
l.x = a
l.q = k
b.q = j
b.t = f
b.v = a
a.u = j
d.z = m
d.u = j
d.s = a
assert e.q.u.u.u.u.u.u.u.txt == "a"