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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: I = None
        self.o: I = None
        self.q: A = None
        self.r: G = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: A = None
        self.q: H = None
        self.w: A = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: I = None
        self.o: I = None
        self.q: A = None
        self.r: G = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: A = None
        self.q: H = None
        self.w: A = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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