class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.p: E = None
        self.u: A = None
        self.txt = txt

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

d.v = e
d.y = i
d.z = b
d.u = a
f.x = a
f.u = i
f.q = e
b.p = f
b.q = i
e.x = b
e.q = i
e.u = a
i.s = f
a.w = b
a.v = i
a.p = i
a.u = d
assert d.z.q.s.x.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.p: E = None
        self.u: A = None
        self.txt = txt

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

d.v = e
d.y = i
d.z = b
d.u = a
f.x = a
f.u = i
f.q = e
b.p = f
b.q = i
e.x = b
e.q = i
e.u = a
i.s = f
a.w = b
a.v = i
a.p = i
a.u = d
assert d.z.q.s.x.u.z.txt == "b"