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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: G = None
        self.s: F = None
        self.o: C = None
        self.w: H = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.v: G = None
        self.x: G = None
        self.y: D = None
        self.w: H = None
        self.s: E = None
        self.u: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: C = None
        self.x: A = None
        self.t: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: G = None
        self.s: F = None
        self.o: C = None
        self.w: H = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.v: G = None
        self.x: G = None
        self.y: D = None
        self.w: H = None
        self.s: E = None
        self.u: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: C = None
        self.x: A = None
        self.t: G = None
        self.txt = txt

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

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