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

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

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

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

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

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

f = A("f")
k = B("k")
c = C("c")
b = D("b")
e = E("e")
i = F("i")
n = E("n")

f.y = k
f.r = c
f.t = b
f.q = b
k.q = e
c.z = i
c.v = b
c.s = e
b.t = e
b.w = k
b.p = n
e.y = b
e.q = n
e.x = c
i.q = k
i.w = k
i.t = b
i.y = b
i.p = c
i.r = f
n.y = b
n.q = e
n.x = c
assert k.q.y.w.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.t: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

f = A("f")
k = B("k")
c = C("c")
b = D("b")
e = E("e")
i = F("i")
n = E("n")

f.y = k
f.r = c
f.t = b
f.q = b
k.q = e
c.z = i
c.v = b
c.s = e
b.t = e
b.w = k
b.p = n
e.y = b
e.q = n
e.x = c
i.q = k
i.w = k
i.t = b
i.y = b
i.p = c
i.r = f
n.y = b
n.q = e
n.x = c
assert k.q.y.w.q.x.txt == "c"