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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: C = None
        self.s: B = None
        self.p: C = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
g = C("g")
f = D("f")
d = E("d")
a = F("a")

h.z = i
h.v = a
h.s = d
i.t = h
g.o = h
g.s = h
g.z = a
g.u = d
f.v = d
f.q = g
f.p = g
f.s = i
d.q = h
d.s = f
d.u = f
d.o = i
d.w = g
a.w = f
a.o = g
assert g.u.q.z.t.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: F = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: C = None
        self.s: B = None
        self.p: C = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
g = C("g")
f = D("f")
d = E("d")
a = F("a")

h.z = i
h.v = a
h.s = d
i.t = h
g.o = h
g.s = h
g.z = a
g.u = d
f.v = d
f.q = g
f.p = g
f.s = i
d.q = h
d.s = f
d.u = f
d.o = i
d.w = g
a.w = f
a.o = g
assert g.u.q.z.t.s.o.txt == "i"