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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.z: A = None
        self.u: C = None
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.z: A = None
        self.u: C = None
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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