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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.s: C = None
        self.p: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.y: G = None
        self.s: D = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.s: C = None
        self.p: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.y: G = None
        self.s: D = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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