class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: C = None
        self.p: A = None
        self.x: C = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.u: D = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: C = None
        self.p: A = None
        self.x: C = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.u: D = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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