class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

k = A("k")
a = B("a")
n = C("n")
c = D("c")
l = E("l")
j = F("j")

k.s = l
k.o = n
k.t = n
a.q = l
a.s = j
n.y = a
c.w = j
c.r = j
c.u = j
c.y = k
l.o = c
l.u = k
l.y = k
l.s = a
j.w = n
assert c.y.o.y.s.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

k = A("k")
a = B("a")
n = C("n")
c = D("c")
l = E("l")
j = F("j")

k.s = l
k.o = n
k.t = n
a.q = l
a.s = j
n.y = a
c.w = j
c.r = j
c.u = j
c.y = k
l.o = c
l.u = k
l.y = k
l.s = a
j.w = n
assert c.y.o.y.s.w.y.txt == "a"