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

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

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: A = None
        self.z: C = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: A = None
        self.z: C = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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

j.v = f
e.o = j
e.w = j
e.v = b
e.u = f
d.w = j
g.r = m
g.q = j
f.w = d
f.z = d
f.q = j
f.u = j
f.x = e
k.x = f
k.v = f
k.y = d
k.u = b
l.x = f
l.v = f
l.y = d
l.u = e
m.r = g
m.q = j
b.o = j
b.w = j
b.v = e
b.u = f
n.x = f
n.v = f
n.y = d
n.u = e
assert k.v.x.v.o.v.w.w.v.q.txt == "j"