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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.s: E = None
        self.t: C = None
        self.r: A = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: D = None
        self.v: B = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

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

k.q = f
k.x = a
k.y = a
i.p = j
i.x = f
e.x = k
e.s = k
e.y = a
e.q = f
e.p = f
f.x = e
f.t = e
f.p = j
f.s = a
f.r = k
f.w = k
a.y = e
j.t = a
j.r = f
j.s = f
j.v = i
j.p = i
assert k.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.s: E = None
        self.t: C = None
        self.r: A = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: D = None
        self.v: B = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

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

k.q = f
k.x = a
k.y = a
i.p = j
i.x = f
e.x = k
e.s = k
e.y = a
e.q = f
e.p = f
f.x = e
f.t = e
f.p = j
f.s = a
f.r = k
f.w = k
a.y = e
j.t = a
j.r = f
j.s = f
j.v = i
j.p = i
assert k.y.y.y.y.txt == "e"