class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.q: F = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: C = None
        self.u: E = None
        self.q: F = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.r: B = None
        self.w: C = None
        self.txt = txt

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

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

f.y = n
f.p = n
f.z = j
f.q = k
f.x = b
j.r = i
j.q = a
j.s = f
h.o = i
h.s = a
h.x = a
h.u = n
h.q = k
h.w = b
i.o = k
b.v = k
b.x = k
b.r = j
b.w = h
k.p = n
k.w = n
k.u = a
n.v = k
n.x = k
n.r = j
n.w = h
a.o = i
a.s = h
a.x = h
a.u = n
a.w = n
a.q = k
assert a.q.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.q: F = None
        self.x: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: C = None
        self.u: E = None
        self.q: F = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.r: B = None
        self.w: C = None
        self.txt = txt

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

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

f.y = n
f.p = n
f.z = j
f.q = k
f.x = b
j.r = i
j.q = a
j.s = f
h.o = i
h.s = a
h.x = a
h.u = n
h.q = k
h.w = b
i.o = k
b.v = k
b.x = k
b.r = j
b.w = h
k.p = n
k.w = n
k.u = a
n.v = k
n.x = k
n.r = j
n.w = h
a.o = i
a.s = h
a.x = h
a.u = n
a.w = n
a.q = k
assert a.q.p.x.txt == "k"