class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: C = None
        self.w: E = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.p: A = None
        self.txt = txt

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

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

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

a = A("a")
c = B("c")
k = C("k")
l = D("l")
f = E("f")
d = A("d")
e = A("e")
i = B("i")

a.z = l
a.u = l
a.t = k
a.w = f
a.v = i
c.r = f
c.w = k
c.p = a
k.p = l
k.r = e
l.p = e
l.x = f
f.y = c
f.x = c
f.u = c
f.r = i
d.z = l
d.u = l
d.t = k
d.w = f
d.v = c
e.z = l
e.u = l
e.t = k
e.w = f
e.v = c
i.r = f
i.w = k
i.p = e
assert c.r.r.p.w.y.r.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: C = None
        self.w: E = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.p: A = None
        self.txt = txt

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

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

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

a = A("a")
c = B("c")
k = C("k")
l = D("l")
f = E("f")
d = A("d")
e = A("e")
i = B("i")

a.z = l
a.u = l
a.t = k
a.w = f
a.v = i
c.r = f
c.w = k
c.p = a
k.p = l
k.r = e
l.p = e
l.x = f
f.y = c
f.x = c
f.u = c
f.r = i
d.z = l
d.u = l
d.t = k
d.w = f
d.v = c
e.z = l
e.u = l
e.t = k
e.w = f
e.v = c
i.r = f
i.w = k
i.p = e
assert c.r.r.p.w.y.r.x.w.txt == "k"