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

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

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

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

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

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

n = A("n")
h = B("h")
g = C("g")
m = D("m")
f = E("f")
i = F("i")
j = D("j")
b = E("b")
c = F("c")
k = D("k")

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

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

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

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

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

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

n = A("n")
h = B("h")
g = C("g")
m = D("m")
f = E("f")
i = F("i")
j = D("j")
b = E("b")
c = F("c")
k = D("k")

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