class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

e = A("e")
b = B("b")
j = C("j")
m = D("m")
c = E("c")
n = F("n")
h = A("h")
i = E("i")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

e = A("e")
b = B("b")
j = C("j")
m = D("m")
c = E("c")
n = F("n")
h = A("h")
i = E("i")

e.z = n
e.r = j
e.p = b
b.w = c
b.y = h
j.t = b
j.s = b
j.u = n
j.q = n
j.p = i
m.y = n
m.x = i
m.u = c
c.x = j
c.o = m
c.z = b
c.r = n
n.u = m
h.z = n
h.r = j
h.p = b
i.x = j
i.o = m
i.z = b
i.r = n
assert j.p.o.x.txt == "i"