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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.p: C = None
        self.x: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.p: C = None
        self.x: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

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