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

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

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

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

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

k = A("k")
l = B("l")
h = C("h")
n = D("n")
c = E("c")
j = B("j")

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

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

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

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

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

k = A("k")
l = B("l")
h = C("h")
n = D("n")
c = E("c")
j = B("j")

k.y = n
k.x = n
l.p = n
l.z = n
l.x = k
l.r = c
l.t = h
h.z = c
h.p = n
n.s = j
n.u = j
n.z = h
c.o = n
c.t = k
c.v = k
c.u = k
c.x = h
j.p = n
j.z = n
j.x = k
j.r = c
j.t = h
assert c.v.x.z.p.z.txt == "h"