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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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