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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: H = None
        self.p: C = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: E = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: H = None
        self.p: C = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: E = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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