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

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

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

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

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

l = A("l")
i = B("i")
m = C("m")
g = D("g")
h = E("h")
c = B("c")
k = E("k")
j = E("j")
b = A("b")

l.t = i
l.o = i
i.v = g
i.y = m
i.r = h
i.x = b
m.y = g
g.o = m
g.y = c
g.p = l
g.v = b
g.u = k
h.q = j
c.v = g
c.y = m
c.r = h
c.x = b
k.q = j
j.q = h
b.t = c
b.o = i
assert k.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

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

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

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

l = A("l")
i = B("i")
m = C("m")
g = D("g")
h = E("h")
c = B("c")
k = E("k")
j = E("j")
b = A("b")

l.t = i
l.o = i
i.v = g
i.y = m
i.r = h
i.x = b
m.y = g
g.o = m
g.y = c
g.p = l
g.v = b
g.u = k
h.q = j
c.v = g
c.y = m
c.r = h
c.x = b
k.q = j
j.q = h
b.t = c
b.o = i
assert k.q.q.q.q.q.q.txt == "h"