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

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

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

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

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

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

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

a.x = j
a.s = f
j.x = d
j.u = n
j.t = c
d.o = c
e.s = b
e.t = n
n.t = b
n.z = a
n.q = j
b.v = a
i.o = e
h.o = e
f.v = a
c.s = f
c.t = n
assert f.v.s.v.s.v.x.u.z.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

a.x = j
a.s = f
j.x = d
j.u = n
j.t = c
d.o = c
e.s = b
e.t = n
n.t = b
n.z = a
n.q = j
b.v = a
i.o = e
h.o = e
f.v = a
c.s = f
c.t = n
assert f.v.s.v.s.v.x.u.z.s.v.txt == "a"