class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.o: G = None
        self.u: C = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.p: F = None
        self.r: E = None
        self.t: F = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: H = None
        self.x: B = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
k = C("k")
a = D("a")
l = E("l")
c = F("c")
f = G("f")
m = H("m")
d = I("d")
n = E("n")

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.p: F = None
        self.r: E = None
        self.t: F = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: H = None
        self.x: B = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
k = C("k")
a = D("a")
l = E("l")
c = F("c")
f = G("f")
m = H("m")
d = I("d")
n = E("n")

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