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

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

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

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

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

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

b.z = f
b.x = c
b.u = k
c.t = b
n.s = h
n.u = h
n.t = c
k.z = f
k.t = h
k.x = c
f.t = h
h.s = n
h.u = n
h.t = c
assert n.t.t.z.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

b.z = f
b.x = c
b.u = k
c.t = b
n.s = h
n.u = h
n.t = c
k.z = f
k.t = h
k.x = c
f.t = h
h.s = n
h.u = n
h.t = c
assert n.t.t.z.t.u.txt == "n"