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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: I = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.u: A = None
        self.r: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.q: H = None
        self.t: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: D = None
        self.v: I = None
        self.s: C = None
        self.t: H = None
        self.z: C = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: E = None
        self.txt = txt

n = A("n")
j = B("j")
f = C("f")
m = D("m")
g = E("g")
i = F("i")
l = G("l")
e = H("e")
k = I("k")
c = H("c")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: I = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.u: A = None
        self.r: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.q: H = None
        self.t: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: D = None
        self.v: I = None
        self.s: C = None
        self.t: H = None
        self.z: C = None
        self.x: D = None
        self.r: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: E = None
        self.txt = txt

n = A("n")
j = B("j")
f = C("f")
m = D("m")
g = E("g")
i = F("i")
l = G("l")
e = H("e")
k = I("k")
c = H("c")

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