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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.r: G = None
        self.x: C = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: G = None
        self.t: D = None
        self.r: G = None
        self.y: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.p: E = None
        self.z: E = None
        self.q: A = None
        self.u: G = None
        self.r: E = None
        self.txt = txt

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

k = A("k")
b = B("b")
a = C("a")
d = D("d")
g = E("g")
h = F("h")
c = G("c")

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: C = None
        self.r: G = None
        self.x: C = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: G = None
        self.t: D = None
        self.r: G = None
        self.y: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.p: E = None
        self.z: E = None
        self.q: A = None
        self.u: G = None
        self.r: E = None
        self.txt = txt

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

k = A("k")
b = B("b")
a = C("a")
d = D("d")
g = E("g")
h = F("h")
c = G("c")

k.v = a
k.s = g
b.x = g
b.y = g
b.u = g
b.q = c
b.v = h
a.w = d
a.v = g
d.u = b
d.p = a
d.x = a
d.r = c
d.q = k
d.z = g
g.x = h
g.q = c
g.r = c
g.t = d
g.y = k
g.p = a
h.t = a
h.o = c
h.u = c
h.p = g
h.z = g
h.r = g
h.q = k
c.z = a
assert b.v.p.x.z.y.txt == "k"