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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
m = C("m")
l = D("l")
i = E("i")
a = F("a")
d = D("d")

b.y = i
b.s = j
j.q = a
j.y = l
j.z = m
j.x = i
m.z = i
l.p = b
l.x = i
l.t = i
i.r = a
i.w = b
i.z = d
a.x = b
a.q = m
a.v = d
a.s = i
d.p = b
d.x = i
d.t = i
assert j.z.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
m = C("m")
l = D("l")
i = E("i")
a = F("a")
d = D("d")

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