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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: B = None
        self.p: D = None
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

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

i = A("i")
b = B("b")
c = C("c")
g = D("g")
k = E("k")
h = E("h")
j = B("j")
n = A("n")

i.p = j
i.s = j
i.x = n
i.o = n
i.z = c
b.w = h
b.s = h
b.y = j
b.p = g
b.t = n
c.x = j
c.o = n
g.t = j
g.y = i
k.t = j
k.s = c
k.z = i
h.t = b
h.s = c
h.z = n
j.w = h
j.y = b
j.p = g
j.t = n
j.s = k
n.p = j
n.x = i
n.o = i
n.z = c
n.s = b
assert n.x.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.z: C = None
        self.s: B = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: B = None
        self.p: D = None
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

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

i = A("i")
b = B("b")
c = C("c")
g = D("g")
k = E("k")
h = E("h")
j = B("j")
n = A("n")

i.p = j
i.s = j
i.x = n
i.o = n
i.z = c
b.w = h
b.s = h
b.y = j
b.p = g
b.t = n
c.x = j
c.o = n
g.t = j
g.y = i
k.t = j
k.s = c
k.z = i
h.t = b
h.s = c
h.z = n
j.w = h
j.y = b
j.p = g
j.t = n
j.s = k
n.p = j
n.x = i
n.o = i
n.z = c
n.s = b
assert n.x.z.x.txt == "j"