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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.w: E = None
        self.z: E = None
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

f.v = a
f.x = b
i.s = b
a.x = d
a.y = e
m.s = i
m.w = i
m.p = h
m.q = a
m.v = e
m.x = d
e.s = a
h.v = e
h.w = e
h.z = e
h.r = i
h.t = i
h.y = d
b.v = a
b.x = f
d.s = i
d.w = i
d.p = h
d.q = a
d.v = e
d.x = m
assert f.v.y.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.w: E = None
        self.z: E = None
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

f.v = a
f.x = b
i.s = b
a.x = d
a.y = e
m.s = i
m.w = i
m.p = h
m.q = a
m.v = e
m.x = d
e.s = a
h.v = e
h.w = e
h.z = e
h.r = i
h.t = i
h.y = d
b.v = a
b.x = f
d.s = i
d.w = i
d.p = h
d.q = a
d.v = e
d.x = m
assert f.v.y.s.y.s.txt == "a"