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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.x: D = None
        self.w: D = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

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

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

i.w = n
i.v = k
f.o = i
h.s = k
h.z = e
k.v = j
e.s = h
e.v = k
e.x = k
e.w = k
e.r = k
e.t = f
n.s = i
n.q = i
n.v = k
n.w = j
n.t = h
j.s = h
j.v = k
j.x = k
j.w = k
j.r = k
j.t = f
assert j.s.s.v.r.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: D = None
        self.x: D = None
        self.w: D = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

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

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

i.w = n
i.v = k
f.o = i
h.s = k
h.z = e
k.v = j
e.s = h
e.v = k
e.x = k
e.w = k
e.r = k
e.t = f
n.s = i
n.q = i
n.v = k
n.w = j
n.t = h
j.s = h
j.v = k
j.x = k
j.w = k
j.r = k
j.t = f
assert j.s.s.v.r.v.x.txt == "k"