class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: B = None
        self.v: D = None
        self.r: J = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: G = None
        self.w: I = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.r: A = None
        self.p: G = None
        self.w: I = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.z: E = None
        self.w: J = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: G = None
        self.w: I = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.r: A = None
        self.p: G = None
        self.w: I = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.z: E = None
        self.w: J = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

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

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

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