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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: D = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: D = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

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

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

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