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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: I = None
        self.z: C = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: I = None
        self.u: F = None
        self.q: C = None
        self.r: C = None
        self.w: F = None
        self.o: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.p: C = None
        self.v: B = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: I = None
        self.z: C = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: I = None
        self.u: F = None
        self.q: C = None
        self.r: C = None
        self.w: F = None
        self.o: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.p: C = None
        self.v: B = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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