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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: A = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.r: D = None
        self.z: A = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.x: F = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: A = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.r: D = None
        self.z: A = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.x: F = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

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