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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.x: E = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

n = A("n")
k = B("k")
i = C("i")
b = D("b")
d = E("d")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.x: E = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

n = A("n")
k = B("k")
i = C("i")
b = D("b")
d = E("d")
h = F("h")

n.w = h
n.s = h
n.p = k
n.y = k
n.q = i
k.r = i
k.p = i
k.x = d
k.u = d
k.y = d
i.o = k
i.t = d
i.z = n
b.r = d
d.u = b
d.o = n
h.q = d
h.p = d
h.o = d
assert k.p.z.q.t.o.txt == "n"