class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: A = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

c.x = l
c.u = e
c.q = e
c.o = g
a.z = e
a.w = l
a.t = j
n.u = e
n.z = m
n.p = b
g.t = m
g.v = c
g.w = c
g.r = e
e.p = n
m.u = e
m.z = n
m.p = g
d.u = e
d.z = m
d.p = l
j.z = e
j.w = b
j.t = a
b.t = m
b.v = c
b.w = c
b.r = e
l.t = d
l.v = c
l.w = c
l.r = e
assert l.v.q.p.p.r.p.u.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: A = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

c.x = l
c.u = e
c.q = e
c.o = g
a.z = e
a.w = l
a.t = j
n.u = e
n.z = m
n.p = b
g.t = m
g.v = c
g.w = c
g.r = e
e.p = n
m.u = e
m.z = n
m.p = g
d.u = e
d.z = m
d.p = l
j.z = e
j.w = b
j.t = a
b.t = m
b.v = c
b.w = c
b.r = e
l.t = d
l.v = c
l.w = c
l.r = e
assert l.v.q.p.p.r.p.u.p.u.p.txt == "n"