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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.z: C = None
        self.o: C = None
        self.q: A = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
a = C("a")
j = D("j")
k = E("k")
i = A("i")

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.z: C = None
        self.o: C = None
        self.q: A = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
a = C("a")
j = D("j")
k = E("k")
i = A("i")

h.o = i
h.y = j
n.t = k
n.v = h
n.z = a
n.o = a
n.q = i
a.x = k
a.p = k
a.o = j
a.s = i
a.z = n
j.v = k
j.t = n
j.q = n
k.x = n
k.u = n
k.s = h
i.o = h
i.y = j
assert h.o.o.y.txt == "j"