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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.w: G = None
        self.x: D = None
        self.s: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.w: G = None
        self.x: D = None
        self.s: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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