class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = 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.q: B = None
        self.o: C = None
        self.v: H = None
        self.u: C = None
        self.p: A = None
        self.w: D = None
        self.s: H = None
        self.t: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.x: A = None
        self.y: G = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

k.y = b
k.t = i
g.t = f
g.u = f
i.v = k
n.s = k
n.t = k
n.x = k
n.u = k
n.o = d
n.v = j
n.y = g
n.w = g
n.p = a
d.t = f
j.x = g
a.q = g
a.t = g
a.o = i
a.u = i
a.v = f
a.s = f
a.p = k
a.w = n
f.p = n
b.p = g
b.v = i
b.x = k
b.y = a
b.q = j
b.t = d
assert f.p.p.v.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = 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.q: B = None
        self.o: C = None
        self.v: H = None
        self.u: C = None
        self.p: A = None
        self.w: D = None
        self.s: H = None
        self.t: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.x: A = None
        self.y: G = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

k.y = b
k.t = i
g.t = f
g.u = f
i.v = k
n.s = k
n.t = k
n.x = k
n.u = k
n.o = d
n.v = j
n.y = g
n.w = g
n.p = a
d.t = f
j.x = g
a.q = g
a.t = g
a.o = i
a.u = i
a.v = f
a.s = f
a.p = k
a.w = n
f.p = n
b.p = g
b.v = i
b.x = k
b.y = a
b.q = j
b.t = d
assert f.p.p.v.p.o.txt == "d"