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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.x: C = None
        self.u: G = None
        self.r: D = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.x: C = None
        self.u: G = None
        self.r: D = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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