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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: A = None
        self.v: F = None
        self.z: D = None
        self.w: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.y: I = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.r: D = None
        self.u: B = None
        self.y: I = None
        self.s: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.r: F = None
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: A = None
        self.v: F = None
        self.z: D = None
        self.w: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.y: I = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.r: D = None
        self.u: B = None
        self.y: I = None
        self.s: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.r: F = None
        self.t: H = None
        self.txt = txt

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

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