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

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

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

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

i = A("i")
h = B("h")
d = C("d")
e = D("e")
l = B("l")
k = B("k")
n = D("n")
g = B("g")
b = D("b")
j = A("j")

i.u = d
i.t = j
i.v = k
i.x = h
h.q = g
h.x = i
h.v = d
h.r = n
d.u = l
e.o = n
e.t = i
l.q = h
l.x = j
l.v = d
l.r = n
k.q = l
k.x = i
k.v = d
k.r = e
n.o = b
n.t = i
g.q = k
g.x = i
g.v = d
g.r = e
b.o = e
b.t = i
j.u = d
j.t = i
j.v = l
j.x = l
assert b.o.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.v: B = None
        self.x: B = None
        self.txt = txt

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

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

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

i = A("i")
h = B("h")
d = C("d")
e = D("e")
l = B("l")
k = B("k")
n = D("n")
g = B("g")
b = D("b")
j = A("j")

i.u = d
i.t = j
i.v = k
i.x = h
h.q = g
h.x = i
h.v = d
h.r = n
d.u = l
e.o = n
e.t = i
l.q = h
l.x = j
l.v = d
l.r = n
k.q = l
k.x = i
k.v = d
k.r = e
n.o = b
n.t = i
g.q = k
g.x = i
g.v = d
g.r = e
b.o = e
b.t = i
j.u = d
j.t = i
j.v = l
j.x = l
assert b.o.t.u.u.txt == "l"