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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.x: E = None
        self.u: B = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.x: E = None
        self.u: B = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

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