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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.r: D = None
        self.w: H = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: C = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: H = None
        self.t: F = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.r: D = None
        self.w: H = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: C = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: H = None
        self.t: F = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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