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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.z: D = None
        self.q: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.z: F = None
        self.q: E = None
        self.v: E = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.w: E = None
        self.q: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.z: D = None
        self.q: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.z: F = None
        self.q: E = None
        self.v: E = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.w: E = None
        self.q: G = None
        self.t: F = None
        self.txt = txt

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

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