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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.u: C = None
        self.s: D = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.y: D = None
        self.t: A = None
        self.z: C = None
        self.txt = txt

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

k.p = g
k.v = g
c.y = g
c.s = l
c.p = k
n.w = g
g.t = c
g.x = c
g.u = b
g.s = j
g.z = n
l.r = k
l.t = k
l.p = a
l.y = j
l.z = i
i.w = j
b.w = g
j.t = c
j.x = c
j.u = i
j.z = i
j.s = g
a.r = k
a.t = k
a.p = l
a.y = j
a.z = i
assert c.p.p.u.w.s.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.u: C = None
        self.s: D = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.y: D = None
        self.t: A = None
        self.z: C = None
        self.txt = txt

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

k.p = g
k.v = g
c.y = g
c.s = l
c.p = k
n.w = g
g.t = c
g.x = c
g.u = b
g.s = j
g.z = n
l.r = k
l.t = k
l.p = a
l.y = j
l.z = i
i.w = j
b.w = g
j.t = c
j.x = c
j.u = i
j.z = i
j.s = g
a.r = k
a.t = k
a.p = l
a.y = j
a.z = i
assert c.p.p.u.w.s.u.w.txt == "j"