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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.s: D = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

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

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

k = A("k")
i = B("i")
c = C("c")
n = D("n")
j = E("j")
h = F("h")

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.s: D = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

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

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

k = A("k")
i = B("i")
c = C("c")
n = D("n")
j = E("j")
h = F("h")

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