class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: B = None
        self.r: G = None
        self.v: G = None
        self.p: B = None
        self.x: E = 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.v: A = None
        self.u: G = None
        self.z: B = None
        self.o: G = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: E = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

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

m = A("m")
l = B("l")
n = C("n")
a = D("a")
b = E("b")
k = F("k")
d = G("d")

m.z = l
l.v = k
l.u = d
l.w = a
n.y = k
n.w = l
n.p = l
n.r = d
n.v = d
n.x = b
a.p = b
b.v = m
b.u = d
b.o = d
b.z = l
b.r = a
b.p = n
k.s = l
k.u = b
k.x = n
k.t = d
d.t = m
d.s = m
assert m.z.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: B = None
        self.r: G = None
        self.v: G = None
        self.p: B = None
        self.x: E = 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.v: A = None
        self.u: G = None
        self.z: B = None
        self.o: G = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: E = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

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

m = A("m")
l = B("l")
n = C("n")
a = D("a")
b = E("b")
k = F("k")
d = G("d")

m.z = l
l.v = k
l.u = d
l.w = a
n.y = k
n.w = l
n.p = l
n.r = d
n.v = d
n.x = b
a.p = b
b.v = m
b.u = d
b.o = d
b.z = l
b.r = a
b.p = n
k.s = l
k.u = b
k.x = n
k.t = d
d.t = m
d.s = m
assert m.z.v.s.txt == "l"