class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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