class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: B = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: B = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

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

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