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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.y: A = None
        self.v: F = None
        self.q: C = None
        self.txt = txt

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

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

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

a.o = j
h.w = i
h.u = j
h.o = j
n.z = j
k.z = i
k.y = i
k.t = a
k.v = f
k.q = n
j.w = k
j.o = k
l.s = k
l.o = j
l.v = n
l.y = n
l.t = n
f.s = k
f.o = j
f.v = n
f.y = n
f.t = n
i.o = j
assert i.o.o.v.o.w.t.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.y: A = None
        self.v: F = None
        self.q: C = None
        self.txt = txt

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

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

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

a.o = j
h.w = i
h.u = j
h.o = j
n.z = j
k.z = i
k.y = i
k.t = a
k.v = f
k.q = n
j.w = k
j.o = k
l.s = k
l.o = j
l.v = n
l.y = n
l.t = n
f.s = k
f.o = j
f.v = n
f.y = n
f.t = n
i.o = j
assert i.o.o.v.o.w.t.o.o.txt == "k"