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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.y: H = None
        self.u: G = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.p: E = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.z: A = None
        self.y: H = None
        self.w: B = None
        self.p: E = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.y: H = None
        self.u: G = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.p: E = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.z: A = None
        self.y: H = None
        self.w: B = None
        self.p: E = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.x: D = None
        self.txt = txt

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

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

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