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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: D = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.p: A = None
        self.r: H = None
        self.s: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: B = None
        self.x: I = None
        self.p: I = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: D = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.p: A = None
        self.r: H = None
        self.s: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: B = None
        self.x: I = None
        self.p: I = None
        self.u: I = None
        self.txt = txt

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

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

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