class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

e = A("e")
m = B("m")
c = C("c")
a = D("a")
b = E("b")
l = F("l")
f = G("f")
d = D("d")

e.q = f
m.u = e
m.o = a
c.w = l
c.u = f
c.x = m
a.x = c
a.o = e
a.z = b
b.o = f
b.s = f
b.p = d
b.z = d
l.p = c
l.s = d
l.v = f
f.s = m
f.p = m
f.z = b
f.r = e
f.u = e
f.x = a
d.x = c
d.o = e
d.z = b
assert e.q.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

e = A("e")
m = B("m")
c = C("c")
a = D("a")
b = E("b")
l = F("l")
f = G("f")
d = D("d")

e.q = f
m.u = e
m.o = a
c.w = l
c.u = f
c.x = m
a.x = c
a.o = e
a.z = b
b.o = f
b.s = f
b.p = d
b.z = d
l.p = c
l.s = d
l.v = f
f.s = m
f.p = m
f.z = b
f.r = e
f.u = e
f.x = a
d.x = c
d.o = e
d.z = b
assert e.q.u.q.u.txt == "e"