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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.q: G = None
        self.t: A = None
        self.o: A = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.q: G = None
        self.t: A = None
        self.o: A = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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