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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.x: A = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

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

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

a.p = j
a.w = j
a.s = j
j.o = d
j.t = d
j.x = f
j.r = c
j.w = c
j.z = e
b.r = e
b.v = e
b.u = j
b.z = j
c.y = d
c.w = f
c.x = f
c.r = f
c.u = a
e.z = f
e.r = f
d.z = e
d.w = e
d.x = c
f.p = j
f.w = j
f.s = j
assert d.w.r.s.x.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: B = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.x: A = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

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

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

a.p = j
a.w = j
a.s = j
j.o = d
j.t = d
j.x = f
j.r = c
j.w = c
j.z = e
b.r = e
b.v = e
b.u = j
b.z = j
c.y = d
c.w = f
c.x = f
c.r = f
c.u = a
e.z = f
e.r = f
d.z = e
d.w = e
d.x = c
f.p = j
f.w = j
f.s = j
assert d.w.r.s.x.w.x.w.txt == "j"