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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: C = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

i = A("i")
j = B("j")
n = C("n")
k = D("k")
a = E("a")
h = F("h")

i.s = j
i.w = a
i.r = n
i.u = k
j.v = n
n.u = j
n.r = k
k.t = a
k.z = i
a.s = h
h.q = a
h.y = a
h.r = n
h.t = k
assert a.s.q.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: C = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

i = A("i")
j = B("j")
n = C("n")
k = D("k")
a = E("a")
h = F("h")

i.s = j
i.w = a
i.r = n
i.u = k
j.v = n
n.u = j
n.r = k
k.t = a
k.z = i
a.s = h
h.q = a
h.y = a
h.r = n
h.t = k
assert a.s.q.s.q.txt == "a"