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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.r: B = None
        self.q: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

m.w = d
h.r = m
h.u = e
h.o = k
h.y = l
a.y = k
a.x = h
a.r = h
a.q = e
a.t = l
k.z = m
k.q = e
k.s = l
d.z = l
d.u = l
d.r = e
d.t = a
e.y = h
e.s = h
e.u = h
e.t = l
e.z = m
e.x = d
e.r = a
l.u = a
assert a.q.z.w.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.r: B = None
        self.q: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

m.w = d
h.r = m
h.u = e
h.o = k
h.y = l
a.y = k
a.x = h
a.r = h
a.q = e
a.t = l
k.z = m
k.q = e
k.s = l
d.z = l
d.u = l
d.r = e
d.t = a
e.y = h
e.s = h
e.u = h
e.t = l
e.z = m
e.x = d
e.r = a
l.u = a
assert a.q.z.w.t.t.txt == "l"