class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.o: C = None
        self.z: F = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: F = None
        self.x: E = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.o: G = None
        self.p: E = None
        self.s: G = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: F = None
        self.x: E = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.o: G = None
        self.p: E = None
        self.s: G = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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