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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.u: G = None
        self.v: G = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.x: D = None
        self.p: D = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: G = None
        self.o: E = None
        self.txt = txt

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

l = A("l")
f = B("f")
k = C("k")
a = D("a")
h = E("h")
m = F("m")
g = G("g")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.u: G = None
        self.v: G = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.x: D = None
        self.p: D = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: G = None
        self.o: E = None
        self.txt = txt

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

l = A("l")
f = B("f")
k = C("k")
a = D("a")
h = E("h")
m = F("m")
g = G("g")

l.s = a
l.v = a
l.x = a
l.w = k
l.r = k
l.p = f
f.o = a
f.p = a
f.u = g
f.v = g
f.s = g
k.v = m
k.q = h
k.t = h
k.x = a
k.p = a
k.z = a
a.v = h
a.z = l
h.p = a
h.v = k
h.u = f
h.y = m
h.o = l
h.t = g
m.r = f
m.u = g
m.o = h
g.y = a
g.p = f
g.t = k
g.q = h
g.w = l
g.x = m
assert k.z.v.p.txt == "a"