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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.s: A = None
        self.t: G = None
        self.q: G = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

l = A("l")
g = B("g")
m = C("m")
c = D("c")
i = E("i")
k = F("k")
d = G("d")
n = E("n")
h = D("h")
f = G("f")

l.u = d
l.t = k
l.x = g
l.r = c
l.z = m
g.t = c
g.v = m
g.o = d
m.u = l
m.v = n
m.r = g
c.v = m
i.z = m
k.x = h
k.p = c
k.s = l
k.t = d
k.q = d
k.z = n
k.u = n
d.t = f
d.s = m
d.x = h
n.z = m
h.v = m
f.t = d
f.s = m
f.x = c
assert m.v.z.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: F = None
        self.x: B = None
        self.r: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.s: A = None
        self.t: G = None
        self.q: G = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

l = A("l")
g = B("g")
m = C("m")
c = D("c")
i = E("i")
k = F("k")
d = G("d")
n = E("n")
h = D("h")
f = G("f")

l.u = d
l.t = k
l.x = g
l.r = c
l.z = m
g.t = c
g.v = m
g.o = d
m.u = l
m.v = n
m.r = g
c.v = m
i.z = m
k.x = h
k.p = c
k.s = l
k.t = d
k.q = d
k.z = n
k.u = n
d.t = f
d.s = m
d.x = h
n.z = m
h.v = m
f.t = d
f.s = m
f.x = c
assert m.v.z.v.z.txt == "m"