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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: F = None
        self.v: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: I = None
        self.t: D = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: F = None
        self.v: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: I = None
        self.t: D = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: I = None
        self.txt = txt

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

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

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