class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.s: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: B = None
        self.r: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: D = None
        self.u: I = None
        self.z: F = None
        self.p: I = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.y: A = None
        self.x: G = None
        self.w: E = None
        self.z: F = None
        self.o: D = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.v: F = None
        self.r: H = None
        self.txt = txt

i = A("i")
k = B("k")
e = C("e")
a = D("a")
b = E("b")
d = F("d")
n = G("n")
f = H("f")
j = I("j")
c = D("c")

i.p = j
i.r = f
k.u = d
k.x = n
k.s = b
k.y = e
e.q = j
e.p = j
e.v = i
a.z = n
a.x = n
a.v = k
a.r = c
a.q = e
b.w = c
b.o = e
b.v = n
d.r = n
d.u = i
n.q = e
n.o = a
n.u = j
n.p = j
n.z = d
n.r = i
f.p = k
f.q = a
f.o = a
f.y = i
f.r = i
f.x = n
f.u = n
f.w = b
f.z = d
j.t = b
j.o = i
j.v = d
j.r = f
c.z = n
c.x = n
c.v = k
c.r = a
c.q = e
assert k.s.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.s: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: B = None
        self.r: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: D = None
        self.u: I = None
        self.z: F = None
        self.p: I = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.y: A = None
        self.x: G = None
        self.w: E = None
        self.z: F = None
        self.o: D = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.v: F = None
        self.r: H = None
        self.txt = txt

i = A("i")
k = B("k")
e = C("e")
a = D("a")
b = E("b")
d = F("d")
n = G("n")
f = H("f")
j = I("j")
c = D("c")

i.p = j
i.r = f
k.u = d
k.x = n
k.s = b
k.y = e
e.q = j
e.p = j
e.v = i
a.z = n
a.x = n
a.v = k
a.r = c
a.q = e
b.w = c
b.o = e
b.v = n
d.r = n
d.u = i
n.q = e
n.o = a
n.u = j
n.p = j
n.z = d
n.r = i
f.p = k
f.q = a
f.o = a
f.y = i
f.r = i
f.x = n
f.u = n
f.w = b
f.z = d
j.t = b
j.o = i
j.v = d
j.r = f
c.z = n
c.x = n
c.v = k
c.r = a
c.q = e
assert k.s.w.x.txt == "n"