class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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