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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

f.o = g
f.v = b
f.s = h
l.o = a
l.s = j
n.t = h
n.w = b
n.z = e
e.o = g
e.r = h
e.q = c
c.v = j
c.y = l
g.u = b
g.t = n
h.t = n
h.w = b
h.z = e
b.o = g
b.r = n
b.q = c
a.u = e
a.t = n
j.u = e
j.t = h
assert n.t.w.r.w.q.v.u.r.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

f.o = g
f.v = b
f.s = h
l.o = a
l.s = j
n.t = h
n.w = b
n.z = e
e.o = g
e.r = h
e.q = c
c.v = j
c.y = l
g.u = b
g.t = n
h.t = n
h.w = b
h.z = e
b.o = g
b.r = n
b.q = c
a.u = e
a.t = n
j.u = e
j.t = h
assert n.t.w.r.w.q.v.u.r.t.t.txt == "h"