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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: A = None
        self.o: A = None
        self.t: D = None
        self.v: D = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: A = None
        self.o: A = None
        self.t: D = None
        self.v: D = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

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