class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: A = None
        self.s: D = None
        self.q: C = None
        self.v: A = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.z: A = None
        self.u: G = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: A = None
        self.s: D = None
        self.q: C = None
        self.v: A = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.z: A = None
        self.u: G = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

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