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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: E = None
        self.o: A = None
        self.t: B = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: E = None
        self.o: A = None
        self.t: B = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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