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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.q: E = None
        self.s: B = None
        self.u: E = None
        self.txt = txt

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

k.v = h
k.o = j
i.r = b
i.z = n
i.v = h
i.q = h
l.x = j
g.o = j
g.q = b
h.z = i
b.v = i
b.x = k
b.q = h
b.u = h
b.s = n
n.r = b
n.z = i
n.v = h
n.q = h
j.o = g
j.q = b
assert k.o.o.q.s.z.r.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.q: E = None
        self.s: B = None
        self.u: E = None
        self.txt = txt

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

k.v = h
k.o = j
i.r = b
i.z = n
i.v = h
i.q = h
l.x = j
g.o = j
g.q = b
h.z = i
b.v = i
b.x = k
b.q = h
b.u = h
b.s = n
n.r = b
n.z = i
n.v = h
n.q = h
j.o = g
j.q = b
assert k.o.o.q.s.z.r.x.v.txt == "h"