class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: F = None
        self.r: F = None
        self.s: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

f = A("f")
j = B("j")
l = C("l")
d = D("d")
e = E("e")
k = F("k")
a = A("a")

f.u = j
f.o = k
f.r = k
f.s = e
f.q = d
j.z = d
j.o = d
j.v = f
j.w = l
l.s = d
d.x = k
d.s = l
e.p = k
k.r = e
k.w = l
a.u = j
a.o = k
a.r = k
a.s = e
a.q = d
assert k.w.s.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: F = None
        self.r: F = None
        self.s: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

f = A("f")
j = B("j")
l = C("l")
d = D("d")
e = E("e")
k = F("k")
a = A("a")

f.u = j
f.o = k
f.r = k
f.s = e
f.q = d
j.z = d
j.o = d
j.v = f
j.w = l
l.s = d
d.x = k
d.s = l
e.p = k
k.r = e
k.w = l
a.u = j
a.o = k
a.r = k
a.s = e
a.q = d
assert k.w.s.x.w.txt == "l"