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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

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

c = A("c")
g = B("g")
i = C("i")
e = D("e")
m = E("m")
n = F("n")
f = B("f")
j = C("j")

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

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

c = A("c")
g = B("g")
i = C("i")
e = D("e")
m = E("m")
n = F("n")
f = B("f")
j = C("j")

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