class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: G = None
        self.o: E = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.z: B = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: G = None
        self.o: E = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.z: B = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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