class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.s: A = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

h = A("h")
e = B("e")
k = C("k")
g = D("g")
f = E("f")
n = C("n")
c = A("c")

h.u = e
h.w = e
h.p = n
h.s = c
h.x = g
e.s = n
e.u = n
e.y = k
e.v = k
e.z = g
k.y = n
g.t = e
f.y = e
f.x = e
f.v = c
f.r = k
n.y = k
c.u = e
c.w = e
c.p = n
c.s = h
c.x = g
assert k.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.s: A = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

h = A("h")
e = B("e")
k = C("k")
g = D("g")
f = E("f")
n = C("n")
c = A("c")

h.u = e
h.w = e
h.p = n
h.s = c
h.x = g
e.s = n
e.u = n
e.y = k
e.v = k
e.z = g
k.y = n
g.t = e
f.y = e
f.x = e
f.v = c
f.r = k
n.y = k
c.u = e
c.w = e
c.p = n
c.s = h
c.x = g
assert k.y.y.y.y.y.txt == "n"