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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: A = None
        self.q: E = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

f = A("f")
k = B("k")
e = C("e")
d = D("d")
g = E("g")
h = F("h")

f.s = d
f.z = d
f.v = k
f.x = h
k.y = d
k.v = h
k.o = f
k.q = e
e.x = k
e.u = f
e.q = g
e.p = g
e.r = d
d.q = k
d.u = k
g.z = h
g.q = h
g.x = k
g.w = k
g.p = f
h.t = f
h.q = f
assert g.w.o.s.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.v: B = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: A = None
        self.q: E = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

f = A("f")
k = B("k")
e = C("e")
d = D("d")
g = E("g")
h = F("h")

f.s = d
f.z = d
f.v = k
f.x = h
k.y = d
k.v = h
k.o = f
k.q = e
e.x = k
e.u = f
e.q = g
e.p = g
e.r = d
d.q = k
d.u = k
g.z = h
g.q = h
g.x = k
g.w = k
g.p = f
h.t = f
h.q = f
assert g.w.o.s.u.q.txt == "e"