class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: G = None
        self.z: E = None
        self.s: G = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: B = None
        self.z: C = None
        self.t: A = None
        self.v: A = None
        self.y: A = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: H = None
        self.v: H = None
        self.u: B = None
        self.t: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: B = None
        self.z: C = None
        self.t: A = None
        self.v: A = None
        self.y: A = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: H = None
        self.v: H = None
        self.u: B = None
        self.t: C = None
        self.txt = txt

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

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