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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: I = None
        self.y: A = None
        self.u: C = None
        self.w: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: A = None
        self.s: I = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.z: F = None
        self.r: I = None
        self.q: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.r: I = None
        self.o: H = None
        self.q: C = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: G = None
        self.y: A = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: I = None
        self.y: A = None
        self.u: C = None
        self.w: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: A = None
        self.s: I = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.z: F = None
        self.r: I = None
        self.q: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.r: I = None
        self.o: H = None
        self.q: C = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: G = None
        self.y: A = None
        self.z: D = None
        self.txt = txt

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

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