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

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.v: A = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: C = None
        self.t: A = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

l.q = c
g.u = c
g.s = c
g.v = e
g.w = h
g.p = j
h.p = d
b.v = h
b.p = h
b.t = h
j.s = l
j.t = l
j.y = h
j.z = h
j.o = e
d.v = h
d.p = h
d.t = h
e.q = g
c.u = g
c.s = g
c.v = e
c.w = h
c.p = j
assert d.t.p.p.p.p.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.v: A = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: C = None
        self.t: A = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

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

l.q = c
g.u = c
g.s = c
g.v = e
g.w = h
g.p = j
h.p = d
b.v = h
b.p = h
b.t = h
j.s = l
j.t = l
j.y = h
j.z = h
j.o = e
d.v = h
d.p = h
d.t = h
e.q = g
c.u = g
c.s = g
c.v = e
c.w = h
c.p = j
assert d.t.p.p.p.p.p.v.txt == "h"