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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.u: F = None
        self.x: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.u: F = None
        self.x: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

f.s = k
f.r = l
k.s = e
k.r = j
k.y = f
a.r = l
a.x = l
a.v = k
a.u = e
a.o = e
l.s = j
l.y = f
j.w = k
m.x = j
m.s = a
m.q = f
e.x = j
e.s = a
e.q = f
assert k.y.r.s.w.txt == "k"