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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: A = None
        self.z: G = None
        self.w: B = None
        self.q: H = None
        self.r: A = None
        self.s: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: B = None
        self.z: C = None
        self.s: B = None
        self.u: C = None
        self.t: F = None
        self.x: E = None
        self.o: G = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: E = None
        self.u: B = None
        self.s: F = None
        self.w: I = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: A = None
        self.z: G = None
        self.w: B = None
        self.q: H = None
        self.r: A = None
        self.s: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: B = None
        self.z: C = None
        self.s: B = None
        self.u: C = None
        self.t: F = None
        self.x: E = None
        self.o: G = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: E = None
        self.u: B = None
        self.s: F = None
        self.w: I = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

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