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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.x: F = None
        self.o: B = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.v: E = None
        self.y: I = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.x: F = None
        self.o: B = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.v: E = None
        self.y: I = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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