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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.q: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: G = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.o: F = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.q: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: G = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.o: F = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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