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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: G = None
        self.y: H = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.x: E = None
        self.z: I = None
        self.y: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: D = None
        self.w: E = None
        self.v: A = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: G = None
        self.y: H = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.x: E = None
        self.z: I = None
        self.y: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: D = None
        self.w: E = None
        self.v: A = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

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

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

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