class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: B = None
        self.u: I = None
        self.t: F = None
        self.x: C = None
        self.y: H = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: I = None
        self.p: G = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: E = None
        self.r: B = None
        self.v: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: I = None
        self.p: G = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: E = None
        self.r: B = None
        self.v: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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