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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: B = None
        self.x: B = None
        self.u: E = None
        self.r: E = None
        self.v: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

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

e.v = g
e.o = m
m.p = k
m.x = k
d.t = k
g.z = m
g.t = m
g.o = a
g.w = a
g.r = k
g.s = d
j.x = a
k.s = a
k.z = m
k.x = m
k.v = m
k.p = m
k.u = j
k.r = j
a.z = g
a.t = g
a.r = m
assert k.v.x.z.p.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: B = None
        self.x: B = None
        self.u: E = None
        self.r: E = None
        self.v: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

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

e.v = g
e.o = m
m.p = k
m.x = k
d.t = k
g.z = m
g.t = m
g.o = a
g.w = a
g.r = k
g.s = d
j.x = a
k.s = a
k.z = m
k.x = m
k.v = m
k.p = m
k.u = j
k.r = j
a.z = g
a.t = g
a.r = m
assert k.v.x.z.p.z.p.txt == "k"