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

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

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

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

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

k.u = a
k.y = g
j.q = n
c.q = a
c.s = h
c.x = h
c.y = b
b.t = j
b.p = a
g.u = a
g.y = n
e.t = j
e.p = j
l.q = j
l.s = h
l.x = h
l.y = e
n.u = j
n.y = g
h.q = j
h.s = c
h.x = l
h.y = e
a.q = n
assert c.y.p.q.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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

k.u = a
k.y = g
j.q = n
c.q = a
c.s = h
c.x = h
c.y = b
b.t = j
b.p = a
g.u = a
g.y = n
e.t = j
e.p = j
l.q = j
l.s = h
l.x = h
l.y = e
n.u = j
n.y = g
h.q = j
h.s = c
h.x = l
h.y = e
a.q = n
assert c.y.p.q.u.q.u.txt == "j"