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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.u: I = None
        self.p: H = None
        self.t: A = None
        self.z: H = None
        self.s: B = None
        self.x: I = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: H = None
        self.z: F = None
        self.y: I = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: H = None
        self.r: A = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

k.x = g
a.p = n
h.o = g
h.r = f
h.u = n
h.x = n
h.y = n
h.p = e
h.z = e
h.t = k
h.s = a
f.w = a
f.u = a
f.p = e
f.z = g
f.y = n
i.u = g
i.x = g
i.z = e
i.r = k
i.o = f
g.s = f
g.y = f
g.z = f
g.o = a
l.o = f
e.u = g
n.y = a
assert g.o.p.y.p.y.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.u: I = None
        self.p: H = None
        self.t: A = None
        self.z: H = None
        self.s: B = None
        self.x: I = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: H = None
        self.z: F = None
        self.y: I = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: H = None
        self.r: A = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

k.x = g
a.p = n
h.o = g
h.r = f
h.u = n
h.x = n
h.y = n
h.p = e
h.z = e
h.t = k
h.s = a
f.w = a
f.u = a
f.p = e
f.z = g
f.y = n
i.u = g
i.x = g
i.z = e
i.r = k
i.o = f
g.s = f
g.y = f
g.z = f
g.o = a
l.o = f
e.u = g
n.y = a
assert g.o.p.y.p.y.p.y.txt == "a"