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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

d.z = f
d.t = b
d.x = g
d.s = g
d.q = l
d.p = k
b.x = g
b.w = l
b.t = h
b.p = d
h.v = d
l.w = d
k.s = h
k.z = l
g.v = d
g.x = d
g.p = b
g.q = b
f.v = d
assert f.v.s.v.s.q.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: B = None
        self.x: F = None
        self.q: D = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

d.z = f
d.t = b
d.x = g
d.s = g
d.q = l
d.p = k
b.x = g
b.w = l
b.t = h
b.p = d
h.v = d
l.w = d
k.s = h
k.z = l
g.v = d
g.x = d
g.p = b
g.q = b
f.v = d
assert f.v.s.v.s.q.w.w.txt == "d"