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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.r: F = None
        self.p: F = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

j = A("j")
l = B("l")
n = C("n")
h = D("h")
f = E("f")
g = F("g")
a = F("a")
b = B("b")
m = C("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.r: F = None
        self.p: F = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

j = A("j")
l = B("l")
n = C("n")
h = D("h")
f = E("f")
g = F("g")
a = F("a")
b = B("b")
m = C("m")

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