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

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

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

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

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

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

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

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

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

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

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