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

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

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

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

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

h.u = j
h.p = j
h.v = e
h.z = c
n.x = c
n.o = c
n.q = e
n.w = h
e.o = h
e.s = j
j.z = e
j.u = n
b.z = e
b.u = n
c.x = n
c.o = n
c.q = e
c.w = h
assert e.s.z.o.p.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.v: C = None
        self.z: B = None
        self.txt = txt

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

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

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

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

h.u = j
h.p = j
h.v = e
h.z = c
n.x = c
n.o = c
n.q = e
n.w = h
e.o = h
e.s = j
j.z = e
j.u = n
b.z = e
b.u = n
c.x = n
c.o = n
c.q = e
c.w = h
assert e.s.z.o.p.z.o.txt == "h"