class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.y: G = None
        self.t: C = None
        self.z: C = None
        self.o: D = None
        self.v: C = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.w: D = None
        self.z: A = None
        self.t: A = None
        self.y: I = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.y: G = None
        self.t: C = None
        self.z: C = None
        self.o: D = None
        self.v: C = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.w: D = None
        self.z: A = None
        self.t: A = None
        self.y: I = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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