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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

n = A("n")
e = B("e")
b = C("b")
k = D("k")
h = E("h")
j = C("j")

n.z = h
n.t = h
n.x = e
n.s = k
e.y = k
e.q = k
e.w = n
e.z = n
b.o = e
k.s = n
h.u = j
h.y = j
h.o = k
j.o = e
assert b.o.z.s.s.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.s: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

n = A("n")
e = B("e")
b = C("b")
k = D("k")
h = E("h")
j = C("j")

n.z = h
n.t = h
n.x = e
n.s = k
e.y = k
e.q = k
e.w = n
e.z = n
b.o = e
k.s = n
h.u = j
h.y = j
h.o = k
j.o = e
assert b.o.z.s.s.x.z.txt == "n"