class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: F = None
        self.txt = txt

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

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