class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: F = None
        self.z: E = None
        self.s: H = None
        self.p: B = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.v: E = None
        self.s: A = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: B = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.u: F = None
        self.t: C = None
        self.p: C = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.v: E = None
        self.s: A = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: B = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.u: F = None
        self.t: C = None
        self.p: C = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

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

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