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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

f.v = m
f.u = m
f.t = m
f.z = k
d.z = e
d.r = k
d.u = f
d.y = f
e.r = m
e.s = c
c.t = m
m.s = f
m.y = f
m.t = l
l.r = e
k.q = c
assert m.t.r.s.t.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

f.v = m
f.u = m
f.t = m
f.z = k
d.z = e
d.r = k
d.u = f
d.y = f
e.r = m
e.s = c
c.t = m
m.s = f
m.y = f
m.t = l
l.r = e
k.q = c
assert m.t.r.s.t.t.r.txt == "e"