class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

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

d.z = g
d.o = m
d.r = n
d.w = n
n.p = d
n.y = d
n.r = g
e.p = j
e.o = f
m.u = g
m.y = j
m.w = d
j.x = k
j.w = n
g.q = l
g.y = m
g.w = e
h.z = m
h.x = e
h.o = n
h.r = g
h.t = k
h.w = d
f.p = k
f.o = e
l.z = m
l.x = f
l.o = n
l.r = g
l.t = k
l.w = d
k.x = j
k.w = n
assert l.w.w.r.y.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

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

d.z = g
d.o = m
d.r = n
d.w = n
n.p = d
n.y = d
n.r = g
e.p = j
e.o = f
m.u = g
m.y = j
m.w = d
j.x = k
j.w = n
g.q = l
g.y = m
g.w = e
h.z = m
h.x = e
h.o = n
h.r = g
h.t = k
h.w = d
f.p = k
f.o = e
l.z = m
l.x = f
l.o = n
l.r = g
l.t = k
l.w = d
k.x = j
k.w = n
assert l.w.w.r.y.w.o.txt == "m"