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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.t: E = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.t: E = None
        self.r: E = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

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

a.x = n
f.y = e
f.q = l
n.v = j
n.t = j
n.r = j
n.y = f
n.o = a
l.x = b
l.u = d
j.p = f
j.t = b
j.v = m
k.p = e
k.t = b
k.v = m
m.x = b
m.u = d
b.y = e
b.q = m
e.y = f
e.q = m
d.x = f
d.u = l
assert f.q.x.y.q.u.u.txt == "l"