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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.u: D = None
        self.v: D = None
        self.o: A = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

e = A("e")
d = B("d")
c = C("c")
m = D("m")
l = E("l")
i = F("i")
k = G("k")

e.x = i
e.q = m
d.u = c
d.q = i
c.w = l
m.r = k
m.x = d
l.t = e
l.o = e
l.r = d
l.u = m
l.v = m
l.s = i
i.r = d
i.t = e
i.s = c
i.y = c
k.z = i
k.p = m
k.s = l
k.r = c
assert d.u.w.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.u: D = None
        self.v: D = None
        self.o: A = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

e = A("e")
d = B("d")
c = C("c")
m = D("m")
l = E("l")
i = F("i")
k = G("k")

e.x = i
e.q = m
d.u = c
d.q = i
c.w = l
m.r = k
m.x = d
l.t = e
l.o = e
l.r = d
l.u = m
l.v = m
l.s = i
i.r = d
i.t = e
i.s = c
i.y = c
k.z = i
k.p = m
k.s = l
k.r = c
assert d.u.w.o.q.txt == "m"