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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: G = None
        self.z: F = None
        self.y: A = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

k.v = e
k.u = m
n.t = e
n.x = a
m.s = e
m.t = n
l.x = n
l.t = k
d.v = m
d.q = e
d.p = e
d.z = a
d.y = k
d.x = n
a.v = d
e.q = d
assert l.t.u.s.q.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: G = None
        self.z: F = None
        self.y: A = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

k.v = e
k.u = m
n.t = e
n.x = a
m.s = e
m.t = n
l.x = n
l.t = k
d.v = m
d.q = e
d.p = e
d.z = a
d.y = k
d.x = n
a.v = d
e.q = d
assert l.t.u.s.q.x.t.txt == "e"