class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.w: C = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: E = None
        self.o: D = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.s: C = None
        self.o: E = None
        self.txt = txt

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

h.r = f
h.x = f
h.q = k
h.w = m
n.o = f
n.w = m
n.q = a
m.x = i
m.v = n
m.p = n
g.t = f
g.u = m
g.s = m
g.y = i
g.z = k
i.v = m
i.y = m
j.p = f
j.q = i
j.o = g
j.s = g
j.w = n
f.t = m
f.w = m
f.s = m
f.o = i
e.r = f
e.x = f
e.q = k
e.w = m
a.r = f
a.x = f
a.q = j
a.w = m
k.p = f
k.q = i
k.o = g
k.s = g
k.w = n
assert f.w.v.w.x.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.w: C = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: E = None
        self.o: D = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.s: C = None
        self.o: E = None
        self.txt = txt

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

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